//
//  ZBMoBanNineCollectionViewCell.m
//  MoBan
//
//  Created by apple on 16/7/21.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ZBMoBanNineCollectionViewCell.h"
@interface ZBMoBanNineCollectionViewCell()
@property(nonatomic,strong)UILabel *lable;
@property(nonatomic,strong)UIImageView *imageview;
@property(nonatomic,assign)NSInteger inter;
@end
@implementation ZBMoBanNineCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addUI];
    }
    return self;
}
-(void)addUI
{
    self.imageview = [[UIImageView alloc]init];
//    [self.contentView addSubview:self.imageview];

    
    self.lable = [[UILabel alloc]init];
    [self.contentView addSubview:self.lable];
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.imageview.frame = self.bounds;
    self.imageview.layer.borderWidth=0.5;
    self.imageview.layer.borderColor = [UIColor grayColor].CGColor;
    self.imageview.layer.cornerRadius = self.height/2;

    self.lable.frame = self.bounds;
    self.lable.layer.borderWidth=0.5;
    self.lable.layer.borderColor = [UIColor grayColor].CGColor;
    self.lable.layer.cornerRadius = self.height/2;

    
}
-(void)ZBSetDatasouce:(NSString *)str
{
    self.lable.text = str;
}
-(void)start
{

    [UIView animateWithDuration:0.05 animations:^{
        self.lable.transform = CGAffineTransformMakeRotation(self.inter*M_PI/72);

    } completion:^(BOOL finished) {
        self.inter=-self.inter;
        if (self.inter==0) {
            self.lable.transform = CGAffineTransformMakeRotation(self.inter*M_PI/72);

        }else
        {
            [self start];

        }

    }];
}
-(void)ZBchangeFram:(CGFloat)inter
{
    self.inter=inter;
    
    [self start];
    
}
@end
